0fa7d532ae3c36636a81d3a22dac9a4c19bd3b7f,ex/SimpleBlockingQueue/src/SimpleBlockingQueue.java,SimpleBlockingQueue,put,#E#,32
Before Change
*/
public synchronized void put(E msg) throws InterruptedException {
mList.add(msg);
notifyAll();
}
/**
After Change
* space to become available.
*/
public void put(E e) throws InterruptedException {
synchronized(this) {
if (e == null)
throw new NullPointerException();
// Wait until the queue is not full.
while (isFull()) {
System.out.println("BLOCKING ON PUT()");
wait();
}
// Add e to the ArrayList.
mList.add(e);
// Notify that the queue may have changed state, e.g., "no
// longer empty".
notifyAll();
}
}